CROSS = arm-none-linux-gnueabi-
ARCH = arm
arch = $(ARCH)

ifeq ($(ARCH), arm)
  arch = ARM
endif

ifeq ($(ARCH), x86)
  arch = IA32
  CROSS = 
endif

INSTALL_DIR = $(ARCH)_install

all:
#	tar xzf udt4.tgz
	$(MAKE) -C udt src.all CROSSPREFIX=$(CROSS) arch=$(arch)
	rm -rf $(INSTALL_DIR) && mkdir $(INSTALL_DIR)
	cp udt/src/libudt.a $(INSTALL_DIR)/
#	rm -rf udt

clean:
	#rm -rf udt 
	rm -rf *_install
	@#rm -f libudt*

info:
	@echo "Usage: make [all(default)|clean|info] CROSS=[cross-prefix] ARCH=[arm|x86]"
	@echo "Default: make <==> make all CROSS=arm-none-linux-gnueabi- ARCH=arm"

